package com.java202411.contoller.session;


import com.java202411.contoller.session.request.SessionCreateRequest;
import com.java202411.entity.SessionEntity;
import com.java202411.service.session.SessionService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class SessionController {
    private final SessionService sessionService;

    @PostMapping("/sessions")
    public SessionEntity createSession(@RequestBody SessionCreateRequest request) {
        return sessionService.createSession(request.getEmail(), request.getPassword());
    }
}
